﻿//-----------------------------------------------------------------------------
// <copyright file="ViewModelCreatedWithView.cs" company="William E. Kempf">
//     Copyright (c) William E. Kempf.
// </copyright>
//-----------------------------------------------------------------------------

namespace OnyxTests.TestArtifacts
{
    using System.ComponentModel;
    using Onyx.Windows;

    /// <summary>
    /// Defines a test "ViewModel" with a constructor taking a <see cref="View"/>.
    /// </summary>
    public class ViewModelCreatedWithView : ViewModel
    {
        /// <summary>
        /// Dummy field for the SomeProperty implementation.
        /// </summary>
        private string someValue;

        /// <summary>
        /// Initializes a new instance of the <see cref="ViewModelCreatedWithView"/> class.
        /// </summary>
        /// <param name="view">The <see cref="View"/> to associate with this instance.</param>
        public ViewModelCreatedWithView(View view)
            : base(view)
        {
        }

        /// <summary>
        /// Gets or sets some property as a simple test of the <see cref="INotifyPropertyChanged"/> implementation.
        /// </summary>
        /// <value>Some property.</value>
        public string SomeProperty
        {
            get
            {
                return this.someValue;
            }

            set
            {
                this.someValue = value;
                this.OnPropertyChanged("SomeProperty");
            }
        }
    }
}
